<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<body>
<script type="text/javascript" src="/${initParam.context_root}/script/pscript3.js"></script>
<script type="text/javascript" src="/${initParam.context_root}/script/pscript4.js"></script>
<table align="center"><tr><td><h2>상품등록</h2></td><td width="100"></td></tr></table>
<form action="/droowa/product/registerProduct.do" onsubmit="return chk(this)" method="post" encType="multipart/form-data">
<table align="center">
	<tr>
		<td align="center" width="100">카테고리</td>
		<td width="300">
			<select name="categoryId" id="categoryId" onchange="chk2()" style="width:345px;">
				<option value='카테고리'>카테고리</option>
				<c:forEach items="${requestScope.category_list}" var="category">
					<option value="${category.categoryId}">
						${category.categoryName}
					</option>
				</c:forEach>
			</select>
		</td>
		<td width="200" id="error0" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">상품명</td>
		<td>
			<input type="text" name="name" id="name" onkeyup="chk3()" style="width:345px;">
		</td>
		<td id="error1" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">가격</td>
		<td>
			<input type="text" name="price" id="price" onkeyup="chk4()" style="width:345px;">
		</td>
		<td id="error2" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">제조사</td>
		<td>
			<input type="text" name="brand" id="brand" onkeyup="chk5()" style="width:345px;">
		</td>
		<td id="error3" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">모델번호</td>
		<td>
			<input type="text" name="modelNo" id="modelNo" onkeyup="chk6()" style="width:345px;">
		</td>
		<td id="error4" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">수량</td>
		<td>
			<input type="text" name="quantity" id="quantity" onkeyup="chk7()" style="width:345px;">
		</td>
		<td id="error5" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">상세설명</td>
		<td>
			<textarea cols="48" rows="10" id="description" name="description" onchange="chk8()"></textarea>
		</td>
		<td id="error6" style="color: red;"></td>
	</tr>
	<tr>
		<td align="center">사진 업로드</td>
		<td>
			<input type="file" name="pic">
		</td>
		<td id="error7" style="color: red;"></td>
	</tr>
	<tr>
		<td align="right" colspan="2">
			<input type="hidden" value="false" name="del">
			<input type="reset" value="초기화" style="width:100px;">
			<input type="submit" value="상품등록" style="width:100px;">
		</td>
	</tr>
</table>
</form>
</body>
